package com.lesson01_JavaBase.collection;

import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;

public class ArrayListTest {
    public static void main(String[] args) {
        ArrayList list =new ArrayList();
        list.add(1);
        list.add("aaa");
        list.add("aaa");
        list.add(3.14);

        System.out.println(list.get(2));
        System.out.println(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }

        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
